package org.example.lanchain.assistant;

import dev.langchain4j.service.MemoryId;
import dev.langchain4j.service.SystemMessage;
import dev.langchain4j.service.UserMessage;
import dev.langchain4j.service.V;
import dev.langchain4j.service.spring.AiService;
import dev.langchain4j.service.spring.AiServiceWiringMode;
import reactor.core.publisher.Flux;

@AiService(
        wiringMode = AiServiceWiringMode.EXPLICIT,
        // chatModel = "qwenChatModel",
        streamingChatModel = "qwenStreamingChatModel",
        chatMemoryProvider = "chatMemoryProvider",
        tools = "appointmentTools",
        // 向量存储
        contentRetriever = "contentRetrieverXiaozhiPinecone")
public interface SeparateMemoryChatAssistant {

    // 系统提示词
    // @SystemMessage("你是我的好朋友，请用东北话回答问题。")
    @SystemMessage(fromResource = "prompt-template.txt")
    String chat(@MemoryId int memoryId, @UserMessage String message);

    // 用户提示词
    @UserMessage("接下来的问题请用英语回答。{{message}}")
    String chat2(@MemoryId int memoryId, @V("message") String message);

    // 多参数
    @SystemMessage(fromResource = "prompt-template2.txt")
    String chat3(@MemoryId int memoryId, @UserMessage String message, @V("name") String name, @V("age") int age);

    // 医疗AI
    @SystemMessage(fromResource = "medical-prompt-template.txt")
    Flux<String> chatMedical(@MemoryId long memoryId, @UserMessage String message);
}
